﻿<UserControl x:Class="GooNews.Controls.NewsItemControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:tk="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
             mc:Ignorable="d"
             FontFamily="{StaticResource PhoneFontFamilyNormal}"
             FontSize="{StaticResource PhoneFontSizeNormal}"
             Foreground="{StaticResource PhoneForegroundBrush}"
             d:DesignHeight="480"
             d:DesignWidth="480">

  <Grid x:Name="LayoutRoot"
        HorizontalAlignment="Stretch"
        Background="Transparent">
    <Grid.CacheMode>
      <BitmapCache />
    </Grid.CacheMode>
    <tk:GestureService.GestureListener>
      <tk:GestureListener Tap="GestureListener_Tap" />
    </tk:GestureService.GestureListener>
    <Grid.ColumnDefinitions>
      <ColumnDefinition />
      <ColumnDefinition Width="Auto" />
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto"
                     MinHeight="24" />
      <RowDefinition Height="Auto"
                     MinHeight="23" />
      <RowDefinition Height="3" />
    </Grid.RowDefinitions>
    <tk:ContextMenuService.ContextMenu>
      <tk:ContextMenu x:Name="itemContext" IsZoomEnabled="False">
        <tk:ContextMenu.Items>
          <tk:MenuItem Header="add to instapaper"
                       x:Name="instaMenuItem" />
          <tk:MenuItem Header="share via email"
                       x:Name="shareEmailMenuItem" />
        </tk:ContextMenu.Items>
      </tk:ContextMenu>
    </tk:ContextMenuService.ContextMenu>
    <TextBlock Text="{Binding Title}"
               TextWrapping="Wrap"
               VerticalAlignment="Top"
               FontSize="{Binding Options.StoryFontSize, Source={StaticResource theVM}}"
               Foreground="{StaticResource foreBrush}" />
    <TextBlock Text="{Binding PublishedSince}"
               TextWrapping="NoWrap"
               FontSize="{StaticResource PhoneFontSizeNormal}"
               Grid.Row="1"
               VerticalAlignment="Top"
               Foreground="{StaticResource foreBrush}" />
    <Image Grid.RowSpan="2"
           Margin="4"
           Grid.Column="1"
           x:Name="theImage"
           VerticalAlignment="Top"
           Width="75"
           Source="{Binding ImageUrl}"
           Visibility="{Binding HasImageUrl, Converter={StaticResource visCvt}}" />
    <Rectangle Height="1"
               Grid.ColumnSpan="2"
               Grid.Row="2"
               Stretch="Fill"
               UseLayoutRounding="False"
               Fill="{StaticResource PhoneSubtleBrush}" />
  </Grid>
</UserControl>
